package cn.njxzc.examples;

/**
 * @version : v1.00
 * @Program Name : JavaProgram.examples.Exam2_16.java
 * @Written by : Roy Xu
 * @Creation Date : 2016��3��5�� ����11:07:05
 * @Description : Need to count the sum of all the factors, and then compare
 *              this number with all factors and whether it is equal to the sum
 *              of the factors.
 * @ModificationHistory Who When What -------- ----------
 *                      ------------------------------------------------ Roy Xu
 *                      2016��3��5������11:07:05 TODO *
 */
public class Exam2_16 {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		int n = 1;
		int k;
		for (int i = 1; i < 10000; i++) {
			int sum = 0;
			System.out.println("i:" + String.valueOf(i));
			for (int j = 1; j < i; j++) {
				if (i % j == 0) {
					sum += j;
					System.out.println("j=" + String.valueOf(j) + ",");

				}
			}
			if (sum == i) {
				// System.out.println(sUMString);
				System.out.println("��ȫ����i=" + String.valueOf(sum));

				n++;
				if (n % 3 == 0) {
					System.out.println();

				}
			}
		}
	}

}
